/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.goods;

import com.enation.app.javashop.client.goods.GoodsWordsClient;
import com.enation.app.javashop.core.client.fallback.goods.GoodsWordsClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.goodssearch.enums.GoodsWordsType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fk
 * @version v2.0
 * @Description: 商品分词client
 * @date 2018/8/21 11:04
 * @since v7.0.0
 */
@FeignClient(name = "goods-service", fallbackFactory = GoodsWordsClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface GoodsWordsClientFeignImpl extends GoodsWordsClient {

    /**
     * 删除某个分词
     *
     * @param words
     */
    @Override
    @RequestMapping(value = "/client/goods-words/del", method = RequestMethod.POST)
    void delete(@RequestParam("words") String words);

    /**
     * 添加一组分词，存在累加数量，不存在新增
     *
     * @param words
     */
    @Override
    @RequestMapping(value = "/client/goods-words/add", method = RequestMethod.POST)
    void addWords(@RequestParam("words") String words);

    /**
     * 删除
     * @param goodsWordsType
     * @param id
     */
    @Override
    @RequestMapping(value = "/client/goods-words/del/{id}", method = RequestMethod.GET)
    void delete(@RequestParam("goods_words_type") GoodsWordsType goodsWordsType, @PathVariable("id") Long id);

    /**
     * 变更商品数量
     * @param words
     */
    @Override
    @RequestMapping(value = "/client/goods-words/update-goods-num", method = RequestMethod.POST)
    void updateGoodsNum(@RequestParam("words")String words);

    /**
     * 变更所有平台提示词商品数量
     */
    @Override
    @RequestMapping(value = "/client/goods-words/batch-update-goods-num", method = RequestMethod.POST)
    void batchUpdateGoodsNum();

}
